<template>
    <div class="subpage platform-news-detail-container">
        <div class="platform-news-detail-box">
            <p class="news-title">{{detail.title}}</p>
            <p class="news-date">
                <span>{{detail.createTime}}</span>
                <span>来源：{{detail.source}}</span>
            </p>
            <div class="news-content" v-html="detail.content"></div>
            <!-- <iframe :src="detail.url" frameborder="0"></iframe> -->
        </div>
    </div>
</template>

<script>
export default {
    data() {
        return {
            detail: {}
        }
    },
    created() {
        this.getDetail()
    },
    methods: {
        getDetail() {
            this.$api.get('/api/bulletin/getById/' + this.$route.query.id)
                .then((res) => {
                    if(res.data.createTime.indexOf('T') != -1) {
                        res.data.createTime = res.data.createTime.replace('T', ' ')
                    }
                    this.detail = res.data
                })
        }
    }
}
</script>

<style lang="scss" scoped>
    .platform-news-detail-container {
        .platform-news-detail-box {
            width: 100%;
            height: 100%;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            padding: 24px;
            box-sizing: border-box;
            background-color: #fff;
            .news-title {
                line-height: 26px;
                font-size: 18px;
                font-weight: 500;
                color: #344047;
                margin-bottom: 10px;
            }
            .news-date {
                margin-bottom: 20px;
                font-size: 12px;
                color: #969C9E;
                span:first-child {
                    margin-right: 20px;
                }
            }
            .news-content {
                /deep/ img {
                    width: 100%;
                    height: auto;
                    margin-left: -2em;
                }
                /deep/ p {
                    margin-bottom: 10px;
                    text-indent: 2em;
                }
            }
        }
    }
    iframe {
        width: 100%;
        height: 100%;
    }
</style>